---
layout: default
---

{% if site.posts.size == 0 %}
  <h2>No post found</h2>
{% endif %}

<div class="posts">

  {% if paginator.page == 1 %}

  <!-- Html Elements for Search -->
  <div id="search-container">
  <input type="text" id="search-input" placeholder="search..."
    style="margin: 0px 0px 20px 0px; height: 40px; width: 100%;">
  <ul id="results-container"></ul>
  </div>

  <!-- Script pointing to search-script.js -->
  <script src="{{site.baseurl}}/assets/js/search-script.js" type="text/javascript"></script>

  <!-- Configuration -->
  <script>
  SimpleJekyllSearch({
    searchInput: document.getElementById('search-input'),
    resultsContainer: document.getElementById('results-container'),
    json: '{{site.baseurl}}/search.json'
  })
  </script>

  {% for post in paginator.posts %}
  {% if post.is_sticky == true %}
    <article class="post">
      <h2>
        <a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a>
      </h2>

      <div clsss="meta">
        <span class="date">
          {{ post.date | date: "%Y-%m-%d" }}
        </span>

        <ul class="tag">
          {% for tag in post.tags %}
          <li>
            <a href="{{ site.baseurl }}/tags.html#{{ tag }}">
              {{ tag }}
            </a>
          </li>
          {% endfor %}
        </ul>
      </div>

      <div class="entry">
        {{ post.description }}
      </div>

      <a href="{{ site.baseurl }}{{ post.url }}" class="read-more">Read More</a>
    </article>
  {% endif %}
  {% endfor %}

  {% endif%}


  {% for post in paginator.posts %}
  {% if post.is_sticky != true %}
    <article class="post">
      <h2>
        <a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a>
      </h2>

      <div clsss="meta">
        <span class="date">
          {{ post.date | date: "%Y-%m-%d" }}
        </span>

        <ul class="tag">
          {% for tag in post.tags %}
          <li>
            <a href="{{ site.baseurl }}/tags.html#{{ tag }}">
              {{ tag }}
            </a>
          </li>
          {% endfor %}
        </ul>
      </div>

      <div class="entry">
        {{ post.description }}
      </div>

      <a href="{{ site.baseurl }}{{ post.url }}" class="read-more">Read More</a>
    </article>
  {% endif%}
  {% endfor %}
</div>

<script> pangu.spacingPage(); </script>

<div class="pagination">
  {% if paginator.previous_page %}
    <span class="prev">
      <a href="{{ site.baseurl }}{{ paginator.previous_page_path }}" class="prev">
        前一页
      </a>
    </span>
  {% endif %}
  {% if paginator.next_page %}
    <span class="next">
      <a href="{{ site.baseurl}}{{ paginator.next_page_path }}" class="next">
        后一页
      </a>
    </span>
  {% endif %}
</div>
